package com.hange.excel.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hange.excel.model.pojo.WorksheetConfig;
import com.hange.excel.service.WorksheetConfigService;
import com.hange.excel.mapper.WorksheetConfigMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author YY
* @description 针对表【worksheet_config(工作表配置表)】的数据库操作Service实现
* @createDate 2024-03-16 17:52:03
*/
@Service
public class WorksheetConfigServiceImpl extends ServiceImpl<WorksheetConfigMapper, WorksheetConfig>
    implements WorksheetConfigService{

    /**
     * 根据工作簿id拿到所有的sheet
     * @param workId 工作簿id
     * @return 返回所有的sheet
     */
    @Override
    public List<WorksheetConfig> getSheetListByWorkId(String workId) {
        return getBaseMapper().selectAllByWorkbookId(workId);
    }

    /**
     * 根据工作簿id拿到所有的sheet
     *
     * @param workId 工作簿id
     * @param wsId
     * @return 返回所有的sheet
     */
    @Override
    public WorksheetConfig getSheetListByWorkIdAndSheetId(String workId, String wsId) {
        return getBaseMapper().selectOneByWorkbookIdAndSheetId(workId, wsId);
    }
}




